<? 
include_once("inc/auth.php");
include_once("inc/form.php");
 ob_end_clean();
$que="select * from a_custdj WHERE ID='".$USER_PRIV_ID."'";
$res_ra = msquery($msconn,$que);
$res_rw=mssql_fetch_array($res_ra);
if($res_rw[PLACE]=="H"){
	$distinct="distinct";
}
echo " ".$distinct." "."ISNULL(".$res_rw[TNAME].".".$res_rw[FIELD].",0)";
?>